package spc.webos.queue;

import java.util.Hashtable;
import spc.webos.pool.ObjectPool;

public abstract class AbstractCnnPool extends ObjectPool {
	protected Hashtable props;
	protected int cnnHoldTime = -1;
	protected int cnnIdleTime = -1;

	protected boolean keepQueue = false;

	public AbstractCnnPool() {
		this.autoIncrease = true;
	}

	public AbstractCnnPool(int max, Hashtable props) {
		this.max = max;
		this.props = props;
		this.autoIncrease = true;
	}

	public AbstractCnnPool(int max, Hashtable props, int cnnHoldTime) {
		this.max = max;
		this.props = props;
		this.cnnHoldTime = cnnHoldTime;
		this.autoIncrease = true;
	}

	public AbstractCnnPool(int max, Hashtable props, int cnnHoldTime,
			int cnnIdleTime) {
		this.max = max;
		this.props = props;
		this.cnnHoldTime = cnnHoldTime;
		this.cnnIdleTime = cnnIdleTime;
		this.autoIncrease = true;
	}

	public AbstractCnnPool(int max, Hashtable props, int cnnHoldTime,
			int cnnIdleTime, boolean autoIncrease) {
		this.max = max;
		this.props = props;
		this.cnnHoldTime = cnnHoldTime;
		this.cnnIdleTime = cnnIdleTime;
		this.autoIncrease = autoIncrease;
	}

	public AbstractCnnPool(int max, Hashtable props, int cnnHoldTime,
			int cnnIdleTime, boolean autoIncrease, long waitTime) {
		this.max = max;
		this.props = props;
		this.cnnHoldTime = cnnHoldTime;
		this.cnnIdleTime = cnnIdleTime;
		this.autoIncrease = autoIncrease;
		this.waitTime = waitTime;
	}

	public int getCnnHoldTime() {
		return this.cnnHoldTime;
	}

	public void setCnnHoldTime(int cnnHoldTime) {
		this.cnnHoldTime = cnnHoldTime;
	}

	public void setProps(Hashtable props) {
		this.props = props;
	}

	public Hashtable getProps() {
		return this.props;
	}

	public int getCnnIdleTime() {
		return this.cnnIdleTime;
	}

	public void setCnnIdleTime(int cnnIdleTime) {
		this.cnnIdleTime = cnnIdleTime;
	}

	public void setKeepQueue(boolean keepQueue) {
		this.keepQueue = keepQueue;
	}

	public boolean isKeepQueue() {
		return this.keepQueue;
	}
}
